<?php

/**
 * @author Paweł
 * @version 1.1
 * @package Arrow
 * @subpackage Orm
 * @link http://arrowplatform.org/
 * @copyright 2009 3code 
 * @license GNU LGPL
 * 
 * @date 2009-06-01 
*/

/** 
 * Interfaces ArrowOrmPersistent with specific DB handling classes
 *
 */
class ArrowOrmQueryRouter
{
	private static function getDS($dbName='_default_'){} //GetDatasource
	
	/**
	 * 
	 * Establish link to Datasource (open file, connect to DB )
	 * @param unknown_type $type
	 * @param unknown_type $host
	 * @param unknown_type $user
	 * @param unknown_type $password
	 * @param unknown_type $dbname
	 * @param unknown_type $charset
	 * @param unknown_type $transaction
	 * @param unknown_type $alias
	 */
	
	
	//this is dastasource::create
	public static function connect( $connectionString ){
		//ArrowLogger::log("[ArrowOrmSqlRouter] connect() ,'db'=>$dbname", ArrowLogger::EL_INFO );
		$ds = new $type( $connectionString );		
		return $ds;
	}
	
	/**
	 * 
	 * Should we replace these with one general method ??
	 * 
	 * 
	 * executeQuery($criteria,$data,queryType);
	 * queryType - string sent by programmer and understood by backend ()
	 * 
	 */
	
public static function executeQuery($criteria,$data,$type);
	


	/**
	 * Preform native (sql,xpath, etc) query on specified Source.
	 * Note: IfSource is not specified Default will be used.
	 *
	 * @param String $query
	 * @param String $dbname
	 * @return Resource
	 */
	public static function query( $query, $dsname = "_default_"){}
	

}
?>